<?php

class Spider_set extends CI_Model{

    function __construct(){
        parent::__construct();
    }
    
    function add_domain(){
       $name = $this->input->post("name"); 
       $domain = $this->input->post("domain");
       $dt = time();
       $now_date = date('Y-m-d H:i:s', $dt);
       $sql = "INSERT INTO  domain(name, domain, createdate) VALUES (?,?,?)";
        $data = $this->db->query($sql, array($name, $domain, $now_date));
       return $data;
    }

    function select_domain(){
        $sql = "SELECT id,  name, domain, createdate FROM domain order by createdate desc";
        $data = $this->db->query($sql);
        return $data;
    }

    function delete(){
        $id = $this->input->get();
        $segs = $this->uri->segment_array();
        $data = $this->uri->slash_segment(3);
        return $segs ;
    }
}
